<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:t="https://code.google.com/p/rad-framework/taglib"
	xmlns:tt="https://code.google.com/p/rad-framework"
	xmlns:s="http://jboss.com/products/seam/taglib">
	
		
		<rich:spacer width="1" height="5"/>
		
		<rich:dataTable id="dataTable#{id}" value="#{folder.childrenList}"
			var="kid" width="100%" rows="#{folder.maxRows}">
			
			<f:facet name="header">
				<rich:columnGroup>
					<ui:remove>
						<ui:include
							src="/#{viewPath == null ? 'jsf' : viewPath}/#{folder.viewPath}#{folder.entityType}/Headers.xhtml"/>
					</ui:remove>
					
					<c:forEach items="#{folder.columns}" var="c">
						<tt:columnHeader label="#{c.label}" property="#{c.name}"
							rendered="#{c.rendered}"/>
					</c:forEach>
					
					<h:column>
						<h:outputText value="#{messages['Action']}"/>
					</h:column>
				</rich:columnGroup>
			</f:facet>
			
			<ui:remove>
				<ui:include
					src="/#{viewPath == null ? 'jsf' : viewPath}/#{folder.viewPath}#{folder.entityType}/Columns.xhtml">
					<ui:param name="row" value="#{kid.instance}"/>
				</ui:include> row="#{kid.instance}" </ui:remove>
			
			<c:forEach items="#{folder.columns}" var="c">
				<tt:column type="#{c.type}" value="#{c.value}"
					rendered="#{c.rendered}"/>
			</c:forEach>
			
			<rich:column width="1%">
				<a4j:form id="navForm#{id}">
					<tt:link id="viewLink"
						styleClass="rad-framework-form-link"
						entityName="#{kid.type}"
						mode="View"
						key="#{kid.key}"
						rendered="#{kid.renderView}">
						<h:graphicImage value="#{messages['ViewIcon']}" border="0"
							title="#{messages['View']}"/>
						<s:conversationId/>
					</tt:link>
					<tt:link id="editLink"
						styleClass="rad-framework-form-link"
						entityName="#{kid.type}"
						mode="Edit"
						key="#{kid.key}"
						rendered="#{kid.renderEdit}">
						<h:graphicImage value="#{messages['EditIcon']}" border="0"
							title="#{messages['Edit']}"/>
						<s:conversationId/>
					</tt:link>
					<a4j:commandLink
						rendered="#{(renderDelete == null ? true : renderDelete) and kid.renderDelete and not folder.manyToMany}"
						onclick="if (!confirm('#{messages['DeleteConfirmation']}')) return false"
						styleClass="rad-framework-form-link" reRender="#{id}TP"
						eventsQueue="viewQ" action="#{kid.delete}">
						<h:graphicImage value="#{messages['DeleteIcon']}" border="0"
							title="#{messages['Delete']}"/>
						<s:conversationId/>
					</a4j:commandLink>
				</a4j:form>
			</rich:column>
			
		</rich:dataTable>
						
		<rich:jQuery selector="#dataTable#{id} tr:odd" query="addClass('rad-framework-row-odd')" />
		<rich:jQuery selector="#dataTable#{id} tr:even" query="addClass('rad-framework-row-even')" />
		<rich:jQuery selector="#dataTable#{id} tr" query="mouseover(function(){jQuery(this).addClass('rad-framework-row-over')})"/>
		<rich:jQuery selector="#dataTable#{id} tr" query="mouseout(function(){jQuery(this).removeClass('rad-framework-row-over')})"/>	
		
		<h:panelGrid columns="1" width="100%" rendered="#{folder.childrenList.size > folder.maxRows}">
			<rich:spacer width="1" height="5"/>
			<a4j:form id="dataTableForm#{id}">
				<rich:datascroller align="right" for="dataTable#{id}"
					maxPages="#{folder.maxPages}"/>
			</a4j:form>
		</h:panelGrid>
	
</ui:composition>